\(\int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx\) [91]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 77 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} \sqrt {a+b} d}-\frac {(a-b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d} \]

[Out]

-(a-b)*cot(d*x+c)/a^2/d-1/3*cot(d*x+c)^3/a/d+b^2*arctan((a+b)^(1/2)*tan(d*x+c)/a^(1/2))/a^(5/2)/d/(a+b)^(1/2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3266, 472, 211} \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} d \sqrt {a+b}}-\frac {(a-b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d} \]

[In]

Int[Csc[c + d*x]^4/(a + b*Sin[c + d*x]^2),x]

[Out]

(b^2*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]])/(a^(5/2)*Sqrt[a + b]*d) - ((a - b)*Cot[c + d*x])/(a^2*d) - Co
t[c + d*x]^3/(3*a*d)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 472

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[(e*x)^m*((a + b*x^n)^p/(c + d*x^n)), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rule 3266

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[x^m*((a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p +
 1)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^4 \left (a+(a+b) x^2\right )} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {1}{a x^4}+\frac {a-b}{a^2 x^2}+\frac {b^2}{a^2 \left (a+(a+b) x^2\right )}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {(a-b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {b^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{a^2 d} \\ & = \frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} \sqrt {a+b} d}-\frac {(a-b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.80 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.55 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {(2 a+b-b \cos (2 (c+d x))) \csc ^2(c+d x) \left (-3 b^2 \arctan \left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )+\sqrt {a} \sqrt {a+b} \cot (c+d x) \left (2 a-3 b+a \csc ^2(c+d x)\right )\right )}{6 a^{5/2} \sqrt {a+b} d \left (b+a \csc ^2(c+d x)\right )} \]

[In]

Integrate[Csc[c + d*x]^4/(a + b*Sin[c + d*x]^2),x]

[Out]

-1/6*((2*a + b - b*Cos[2*(c + d*x)])*Csc[c + d*x]^2*(-3*b^2*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]] + Sqrt[
a]*Sqrt[a + b]*Cot[c + d*x]*(2*a - 3*b + a*Csc[c + d*x]^2)))/(a^(5/2)*Sqrt[a + b]*d*(b + a*Csc[c + d*x]^2))

Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.90

method result size
derivativedivides \(\frac {-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {a -b}{a^{2} \tan \left (d x +c \right )}+\frac {b^{2} \arctan \left (\frac {\left (a +b \right ) \tan \left (d x +c \right )}{\sqrt {a \left (a +b \right )}}\right )}{a^{2} \sqrt {a \left (a +b \right )}}}{d}\) \(69\)
default \(\frac {-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {a -b}{a^{2} \tan \left (d x +c \right )}+\frac {b^{2} \arctan \left (\frac {\left (a +b \right ) \tan \left (d x +c \right )}{\sqrt {a \left (a +b \right )}}\right )}{a^{2} \sqrt {a \left (a +b \right )}}}{d}\) \(69\)
risch \(\frac {2 i \left (3 b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a \,{\mathrm e}^{2 i \left (d x +c \right )}-6 b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 a +3 b \right )}{3 d \,a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, d \,a^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {-2 i a^{2}-2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, d \,a^{2}}\) \(251\)

[In]

int(csc(d*x+c)^4/(a+b*sin(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/3/a/tan(d*x+c)^3-(a-b)/a^2/tan(d*x+c)+b^2/a^2/(a*(a+b))^(1/2)*arctan((a+b)*tan(d*x+c)/(a*(a+b))^(1/2))
)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (67) = 134\).

Time = 0.27 (sec) , antiderivative size = 451, normalized size of antiderivative = 5.86 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\left [-\frac {4 \, {\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (b^{2} \cos \left (d x + c\right )^{2} - b^{2}\right )} \sqrt {-a^{2} - a b} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (d x + c\right )^{3} - {\left (a + b\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} - a b} \sin \left (d x + c\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (d x + c\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) \sin \left (d x + c\right ) - 12 \, {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right )}{12 \, {\left ({\left (a^{4} + a^{3} b\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{4} + a^{3} b\right )} d\right )} \sin \left (d x + c\right )}, -\frac {2 \, {\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (b^{2} \cos \left (d x + c\right )^{2} - b^{2}\right )} \sqrt {a^{2} + a b} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (d x + c\right )^{2} - a - b}{2 \, \sqrt {a^{2} + a b} \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 6 \, {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right )}{6 \, {\left ({\left (a^{4} + a^{3} b\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{4} + a^{3} b\right )} d\right )} \sin \left (d x + c\right )}\right ] \]

[In]

integrate(csc(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

[-1/12*(4*(2*a^3 - a^2*b - 3*a*b^2)*cos(d*x + c)^3 + 3*(b^2*cos(d*x + c)^2 - b^2)*sqrt(-a^2 - a*b)*log(((8*a^2
 + 8*a*b + b^2)*cos(d*x + c)^4 - 2*(4*a^2 + 5*a*b + b^2)*cos(d*x + c)^2 + 4*((2*a + b)*cos(d*x + c)^3 - (a + b
)*cos(d*x + c))*sqrt(-a^2 - a*b)*sin(d*x + c) + a^2 + 2*a*b + b^2)/(b^2*cos(d*x + c)^4 - 2*(a*b + b^2)*cos(d*x
 + c)^2 + a^2 + 2*a*b + b^2))*sin(d*x + c) - 12*(a^3 - a*b^2)*cos(d*x + c))/(((a^4 + a^3*b)*d*cos(d*x + c)^2 -
 (a^4 + a^3*b)*d)*sin(d*x + c)), -1/6*(2*(2*a^3 - a^2*b - 3*a*b^2)*cos(d*x + c)^3 + 3*(b^2*cos(d*x + c)^2 - b^
2)*sqrt(a^2 + a*b)*arctan(1/2*((2*a + b)*cos(d*x + c)^2 - a - b)/(sqrt(a^2 + a*b)*cos(d*x + c)*sin(d*x + c)))*
sin(d*x + c) - 6*(a^3 - a*b^2)*cos(d*x + c))/(((a^4 + a^3*b)*d*cos(d*x + c)^2 - (a^4 + a^3*b)*d)*sin(d*x + c))
]

Sympy [F]

\[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\int \frac {\csc ^{4}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \]

[In]

integrate(csc(d*x+c)**4/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(csc(c + d*x)**4/(a + b*sin(c + d*x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.90 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\frac {3 \, b^{2} \arctan \left (\frac {{\left (a + b\right )} \tan \left (d x + c\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} a^{2}} - \frac {3 \, {\left (a - b\right )} \tan \left (d x + c\right )^{2} + a}{a^{2} \tan \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(csc(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

1/3*(3*b^2*arctan((a + b)*tan(d*x + c)/sqrt((a + b)*a))/(sqrt((a + b)*a)*a^2) - (3*(a - b)*tan(d*x + c)^2 + a)
/(a^2*tan(d*x + c)^3))/d

Giac [A] (verification not implemented)

none

Time = 0.46 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.44 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\frac {3 \, {\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (d x + c\right ) + b \tan \left (d x + c\right )}{\sqrt {a^{2} + a b}}\right )\right )} b^{2}}{\sqrt {a^{2} + a b} a^{2}} - \frac {3 \, a \tan \left (d x + c\right )^{2} - 3 \, b \tan \left (d x + c\right )^{2} + a}{a^{2} \tan \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(csc(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/3*(3*(pi*floor((d*x + c)/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(d*x + c) + b*tan(d*x + c))/sqrt(a^2 + a*b)
))*b^2/(sqrt(a^2 + a*b)*a^2) - (3*a*tan(d*x + c)^2 - 3*b*tan(d*x + c)^2 + a)/(a^2*tan(d*x + c)^3))/d

Mupad [B] (verification not implemented)

Time = 13.89 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.88 \[ \int \frac {\csc ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {b^2\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {a+b}}{\sqrt {a}}\right )}{a^{5/2}\,d\,\sqrt {a+b}}-\frac {\frac {1}{3\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a-b\right )}{a^2}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^3} \]

[In]

int(1/(sin(c + d*x)^4*(a + b*sin(c + d*x)^2)),x)

[Out]

(b^2*atan((tan(c + d*x)*(a + b)^(1/2))/a^(1/2)))/(a^(5/2)*d*(a + b)^(1/2)) - (1/(3*a) + (tan(c + d*x)^2*(a - b
))/a^2)/(d*tan(c + d*x)^3)